Skip to content

Add affine Schubert polynomial support via length-additive affine/finite factorization#3

Draft
Copilot wants to merge 3 commits into
mainfrom
copilot/add-affine-schubert-polynomials
Draft

Add affine Schubert polynomial support via length-additive affine/finite factorization#3
Copilot wants to merge 3 commits into
mainfrom
copilot/add-affine-schubert-polynomials

Conversation

Copilot AI commented May 20, 2026

Copy link
Copy Markdown

This PR adds affine Schubert polynomials for (w \in \widetilde{S}n) using the requested decomposition formula
[
\widetilde{\mathfrak{S}}w=\sum{w=w_1w_2,\ \ell(w_1)+\ell(w_2)=\ell(w)} F
{w_1},\mathfrak{S}_{w_2},
]
integrated into the existing Schubert-family module and API style.

  • New affine decomposition helper

    • Added additive_affine_length_decomposition(w) in schubert_polynomials.py.
    • Enumerates all pairs ((w_1,w_2)) with:
      • (w_1) in affine type (\widetilde{A}_{n-1}),
      • (w_2 \in S_n),
      • (w = w_1 w_2),
      • additive Coxeter length.
    • Includes type checks for affine type A input.
  • New user-facing affine Schubert constructor

    • Added affine_Schubert(w, base_ring=ZZ, x_pref='x', sf_basis='s').
    • Builds coefficients in base_ring[x1,...,xn] and returns a symmetric function in the requested basis.
    • Computes each term as:
      • w1.stanley_symmetric_function() (affine Stanley part),
      • multiplied by ordinary Schubert polynomial of w2.
  • Documentation updates

    • Added doctests for:
      • decomposition output on a concrete affine element,
      • identity case,
      • nontrivial affine examples,
      • basis selection (sf_basis='m').
    • Updated README feature list to include affine Schubert polynomials.
W = WeylGroup(['A',2,1], prefix='s')
w = W.from_reduced_word([0,1])

affine_Schubert(w)
# x1*s[1] + s[1, 1]

additive_affine_length_decomposition(w)
# [('s0*s1', [1,2,3]), ('s0', [2,1,3])]  # formatted
Original prompt

Implement affine Schubert polynomials in ghseeli/combinatorialpolynomials.

Context:

  • The repository already implements several Schubert-family constructions in schubert_polynomials.py, including ordinary, double, quantum, and quantum double Schubert polynomials.

  • The user wants affine Schubert polynomials for affine permutations w \in \tilde{S}_n.

  • The intended formula is:

    affine_schubert(w) = sum([w1.stanley_symmetric_function()*schubert(w2) for (w1,w2) in additive_affine_length_decomposition(w)])

  • Here additive_affine_length_decomposition(w) means all pairs (w1, w2) such that:

    • w1 \in \tilde{S}_n
    • w2 \in S_n
    • w = w1 * w2
    • length(w1) + length(w2) = length(w)

Expected behavior/design guidance:

  • Add support for computing affine Schubert polynomials in this library.
  • Place the implementation in the existing Schubert-related module(s), most likely schubert_polynomials.py, unless a clearly better repo-consistent location emerges.
  • Reuse existing repository patterns where appropriate, especially helper-style APIs like reduced_factorization_pairs and the existing Schubert-family functions.
  • Use the affine decomposition formula above as the mathematical definition.
  • The result should live naturally in symmetric functions with coefficients in ZZ[x_1, ..., x_n] (or a configurable base ring consistent with existing APIs).
  • If the repo already has infrastructure suitable for representing symmetric functions in alphabets with polynomial coefficients, integrate with it rather than inventing a less consistent representation.
  • If Sage affine permutation / affine Stanley symmetric function APIs require coercions or wrappers, implement the needed glue code.
  • Prefer a practical, user-facing function API, e.g. something like affine_Schubert(...), plus any helper needed for additive affine length decompositions.
  • Add doctests/tests illustrating basic usage and at least a few nontrivial examples.
  • Update README documentation if appropriate to mention affine Schubert polynomials among implemented families.

Repository context already observed:

  • schubert_polynomials.py contains existing functions such as reduced_factorization_pairs, quantum_Schubert, quantum_double_Schubert, and Schubert-family helper ring classes.
  • multi_sf.py contains SymFnInAlphabetsRing, which may be useful for representing symmetric functions in one alphabet with polynomial coefficients.

Implementation expectations:

  • Investigate the exact Sage interfaces available in this repo context for affine permutations and stanley_symmetric_function().
  • Make the implementation robust to parent/coercion issues.
  • Keep the code style aligned with the repository’s current style.
  • Open a pull request with the implementation and tests/doc updates.

The following is the prior conversation context from the user's chat exploration (may be truncated):

User: I want to implement affine Schubert polynomials in this library. For affine permutation w \in \tilde{S}_n, can think of them as living in symmetric functions with coefficients in ZZ[x_1,...,x_n]. The formula I want to use is affine_schubert(w) = sum([w1.stanley_symmetric_function()schubert(w2)for (w1,w2) in additive_affine_length_decomposition(w)]) and the additive affine length decompositions are all pairs w1 \in \tilde{S}_n, w2 \in S_n such that w = w1w2 and \ell(w1)+\ell(w2) = \ell(w).

Assistant: Yes — the natural place is schubert_polynomials.py, and the implementation should mirror the existing pattern used for quantum_Schubert, quantum_double_Schubert, and the factorization helper reduced_factorization_pairs. The repo already centralizes Schubert-family constructions there, including the reduced-length factorization helper at reduced_factorization_pairs and the quantum Schubert construction based on a basis expansion. python name=schubert_polynomials.py url=https://github.com/ghseeli/combinatorialpolynomials/blob/aeb2f37199761f670a6d535d22061d3b905c27e8/schubert_polynomials.py#L393-L421 def reduced_factorization_pairs(w): r""" Given a permutation ``w``, return all pairs `(u,v)` such that `u \cdot v = w` and `\ell(u)+\ell(v) = \ell(w)`. """ w = Permutation(w) n = len(w) P = Permutations(n) red_words = w.reduced_words() pairs = [(P(w),P.identity()),(P.identity(),P(w))] for word in red_words: for s in range(len(word)): u = P.from_reduced_word(word[:s]) v = P.from_reduced_word(word[s:]) pairs.append((u,v)) return list(set(pairs)) and ```python name=schubert_polynomials.py url=

def quantum_Schubert(perm, base_ring=QQ, start=1):
r"""
Return the quantum Schubert polynomial associated to permutation ``perm`` from the corresponding paper by Fomin-Gelfand-Postnikov.
EXAMPLES::
sage: quantum_Schubert([3,1,2])
x1^2 - q1
sage: quantum_Schubert([1,2,3])
1
sage: quantum_Schubert([1,3,2])
x1 + x2
sage: A = generate_quantum_polynomial_ring(QQ, 3)
sage: x1,x2,x3,q1,q2,q3 = A.gens()
sage: quantum_Schubert([3,4,1,2]) == x1*x1*x2*x2 + 2*q1*x1*x2 - q2*x1*x1 + q1*q1 + q1*q2
True
"""
schub_in_e = Schubert_in_e(perm, base_ring)
coeffs_in_e = [coeff for (coeff,supp) in schub_in_e]
d = Permutation(perm).length()
poly_in_quantum_E = sum([coeff*elm for (elm,coeff) in zip(quantum_e_basis(d, len(perm)-1, br=base_ring, start=start),coeffs_in_e)])
return poly_in_quantum_E

def quantum_Schubert(perm, base_ring=QQ, start=1):
...
schub_in_e = Schubert_in_e(perm, base_ring)
coeffs_in_e = [coeff for (coeff,supp) in schub_in_e]
d = Permutation(perm).length()
poly_in_quantum_E = sum([coeff*elm...

This pull request was created from Copilot chat.

Copilot AI changed the title [WIP] Add affine Schubert polynomials to combinatorial polynomials Add affine Schubert polynomial support via length-additive affine/finite factorization May 20, 2026
Copilot AI requested a review from ghseeli May 20, 2026 21:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants